function CreerCompte()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	if(CheckAll())
	{
		var nom = document.getElementById('nom').value;
		var prenom = document.getElementById('prenom').value;
		var mail = document.getElementById('mail1').value;
		var password = document.getElementById('password1').value;
		var voie1 = document.getElementById('voie1').value;
		var voie2 = document.getElementById('voie2').value;
		var codepostal = document.getElementById('codepostal').value;
		var ville = document.getElementById('ville').value;
		var Selectpays = document.getElementById('pays');
		var tel = document.getElementById('tel').value;
		var pays = Selectpays.options[Selectpays.selectedIndex].value;
	
		FenetreContent.style.top = Offset+50+'px';
		FenetreContent.style.visibility = 'visible';
		FenetreBG.style.display = 'block';
		DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
		
		GetPageContent('GET', 'functions/CreateAccount.php?nom='+nom+
														'&prenom='+prenom+
														'&mail='+mail+
														'&password='+password+
														'&voie1='+voie1+
														'&voie2='+voie2+
														'&codepostal='+codepostal+
														'&ville='+ville+
														'&pays='+pays+
														'&tel='+tel
														, '', RemplirDivFenetre, null, true);		
	}
	
	return;
}

function OuvrirConcept()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetConceptHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirCollectionClub()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	DivFenetre.style.width = '550px';
	FenetreContent.style.width = '550px';
	FenetreContent.style.marginLeft = '-275px';
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetCollectionImagesByCategoryHTML.php?categorie=club', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirCollectionAtelier()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	DivFenetre.style.width = '550px';
	FenetreContent.style.width = '550px';
	FenetreContent.style.marginLeft = '-275px';
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetCollectionImagesByCategoryHTML.php?categorie=atelier', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirCreerCompte()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetCreateAccountPannelHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirCredits()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetCreditsHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirContactsEnsavoirplus()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetContactsEnsavoirplusHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirLivraison()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetLivraisonHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirRetoursechanges()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetRetoursechangesHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirModespaiement()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetModespaiementHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirMotDePasseOublie()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetPassForgottenPannelHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function EnvoyerMailRetrouverPass()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	var DivMail = parent.document.getElementById('recoverpass_mail');
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetSendPassForgottenHTML.php?mail='+DivMail.value, '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirPanneauCompte()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	if(Connected)
	{
		var Iframe = document.getElementById("page");
		Iframe.contentDocument.location = 'cadre_compte.php';
	}
	else
	{
		FenetreContent.style.top = Offset+50+'px';
		FenetreContent.style.visibility = 'visible';
		FenetreBG.style.display = 'block';
		DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
		
		GetPageContent('GET', 'functions/GetAccountPannelHTML.php', '', RemplirDivFenetre, null, true);
	}
	
	return;
}

function OuvrirConnectionCompteResultat()
{
	var FenetreBG = parent.document.getElementById("fenetre-bg");
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	var Mail = document.getElementById('mail').value;
	var Pass = document.getElementById('password').value;
	
	SetDefaultSettings();
	
	FenetreContent.style.top = Offset+50+'px';
	FenetreContent.style.visibility = 'visible';
	FenetreBG.style.display = 'block';
	DivFenetre.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetConnectAccountHTML.php?mail='+Mail+'&pass='+Pass, '', RemplirDivFenetre, null, true);
	
	return;
}

function OuvrirFicheTshirtById(ID, Idvignette)
{
	var FicheTshirtBG = parent.document.getElementById("fenetre-bg");
	var FicheTshirtContent = parent.document.getElementById("fenetre-content");
	var DivFicheTshirt = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FicheTshirtContent.style.top = Offset+50+'px';
	FicheTshirtContent.style.visibility = 'visible';
	FicheTshirtBG.style.display = 'block';
	DivFicheTshirt.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetPhotoTshirtHTMLById.php?tshirtid='+ID+'&vignetteid='+Idvignette, '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirExplicationTshirtById(ID)
{
	var FicheTshirtBG = parent.document.getElementById("fenetre-bg");
	var FicheTshirtContent = parent.document.getElementById("fenetre-content");
	var DivFicheTshirt = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FicheTshirtContent.style.top = Offset+50+'px';
	FicheTshirtContent.style.visibility = 'visible';
	FicheTshirtBG.style.display = 'block';
	DivFicheTshirt.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetExplicationTshirtHTMLById.php?tshirtid='+ID, '', RemplirDivFenetre, null, true);		
	
	return;
}

function OuvrirAjouterTshirtPanier(idtshirt, nb, taille)
{
	var FicheTshirtBG = parent.document.getElementById("fenetre-bg");
	var FicheTshirtContent = parent.document.getElementById("fenetre-content");
	var DivFicheTshirt = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FicheTshirtContent.style.top = Offset+50+'px';
	FicheTshirtContent.style.visibility = 'visible';
	FicheTshirtBG.style.display = 'block';
	DivFicheTshirt.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetAddItemPanierHTML.php?idtshirt='+idtshirt+'&nombre='+nb+'&taille='+taille, '', RemplirDivFenetre, '1', true);
	
	return;
}

function OuvrirBesoinDAide()
{
	var FicheTshirtBG = parent.document.getElementById("fenetre-bg");
	var FicheTshirtContent = parent.document.getElementById("fenetre-content");
	var DivFicheTshirt = parent.document.getElementById('fenetre');
	var Offset = parent.pageYOffset;
	
	SetDefaultSettings();
	
	FicheTshirtContent.style.top = Offset+50+'px';
	FicheTshirtContent.style.visibility = 'visible';
	FicheTshirtBG.style.display = 'block';
	DivFicheTshirt.innerHTML = '<p style="color: gray;">Chargement...</p>';
	
	GetPageContent('GET', 'functions/GetBesoinDAideHTML.php', '', RemplirDivFenetre, null, true);		
	
	return;
}

function RemplirDivFenetre(success, text, param)
{
	var DivFenetre = parent.document.getElementById('fenetre');
	
	if(success)
		DivFenetre.innerHTML = text;
	else
		DivFenetre.innerHTML = '<p style="color: red;">Impossible de se connecter aux données. Veuillez signaler ce problème à l\'administrateur.</p>';

	if(text.substr(0, 40) == '<p style="text-align: center;">Bienvenue')
		Connected = true;

	switch(param)
	{
		case '1':
			UptdateNumberItemsPanier();
			break;
	}
}

function SetDefaultSettings()
{
	var FenetreContent = parent.document.getElementById("fenetre-content");
	var DivFenetre = parent.document.getElementById('fenetre');
	
	DivFenetre.style.width = '810px';
	FenetreContent.style.width = '850px';
	FenetreContent.style.marginLeft = '-425px';

	return;
}